<?php

//index.php
require_once 'controller/ControllerPrincipal.php';
require_once 'controller/ControllerError.php';
require_once 'controller/ControllerBackOffice.php';
$controller = new ControllerPrincipal();
$error = new ControllerError();
/*if (!preg_match("/^page=[a-zA-Z0-9\%]*$/", $_SERVER['QUERY_STRING'])) {
    $error->index();
} else {*/
    if (isset($_GET['page'])) {
        $action = $_GET['page'];
    } else {
        $action = 'Accueil';
    }

    switch ($action) {
        case "Accueil" :
            $controller->accueil($action);
            break;
        case "Photos" :
            $controller->photos($action);
            break;
        case "Midi" :
            $controller->midi($action);
            break;
        case "Soir" :
            $controller->soir($action);
            break;
        case "Adresse" :
            $controller->adresse($action);
            break;
        case "Evénements" :
            $controller->event($action);
            break;
        case "participation" :
            $controller->participation();
            break;
        case "other_page" :
            $controller->otherPage();
            break;
        case "adminSite" :
            $controlerBackOffice = new ControllerBackOffice();
            $controlerBackOffice->index();
            break;
        default :
            $error->index();
   // }
}
?>